import { $post, $get, $delete, $put } from '../utils/request'

// 查询文章分类标签
export let $getArticleTypes = async () => {
    let ret = await $get('article/type')
    return ret;
}

// 查询文章列表
export let $getArticles = async (params) => {
    let ret = await $get('article/page', params)
    console.log(ret);
    return ret;
}

// 查询文章详情
export let $getArticleDetail = async (params) => {
    let ret = await $get('article', params)
    console.log(ret);
    return ret;
}

// 查询文章详情
export let $getArticle = async (params) => {
    let ret = await $get('article/post', params)
    console.log(ret);
    return ret;
}

// 删除文章
export let $deleteArticle = async (params) => {
    let ret = await $delete('article', params)
    return ret;
}

// 设置最佳答案
export let $setBestAnswer = async (params) => {
    let ret = await $post('article/put', params)
    console.log(ret);
    return ret;
}

